DYN-9707: Fix ForceBlockRun not applied when opening legacy XML workspaces#17167
Merged
jasonstratton merged 2 commits intoJun 17, 2026
Merged
Conversation
The ForceBlockRun refactor in DynamoDS#17153 wired the forceBlockRun flag through the JSON open path (OpenJsonFile) but missed the legacy XML open path (OpenXmlFileFromPath), leaving ForceBlockRun unset for any .dyn file in old XML format. Fix: add forceBlockRun parameter to OpenXmlFileFromPath and set it on the HomeWorkspaceModel's RunSettings before OpenWorkspace is called, mirroring what the JSON path already does. Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
See the ticket for this pull request: https://jira.autodesk.com/browse/DYN-9707
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes a regression in Dynamo’s legacy XML workspace open path so the forceBlockRun flag is no longer dropped when opening older XML-format .dyn graphs, aligning behavior with the JSON open path and ensuring file-trust blocking is applied consistently.
Changes:
- Pass
forceBlockRunthroughOpenFileFromPathCoreintoOpenXmlFileFromPathfor legacy XML workspaces. - Apply
RunSettings.ForceBlockRunto the openedHomeWorkspaceModelbefore callingOpenWorkspace.
Comment on lines
2465
to
+2469
| /// <param name="forceManualExecutionMode">Set this to true to discard | ||
| /// execution mode specified in the file and set manual mode</param> | ||
| /// <param name="isTemplate">When true, marks the opened workspace as a template (for example when opened via <see cref="OpenTemplateFromPath"/>).</param> | ||
| /// <returns>True if workspace was opened successfully</returns> | ||
| private bool OpenXmlFileFromPath(XmlDocument xmlDoc, string filePath, bool forceManualExecutionMode, bool isTemplate = false) | ||
| private bool OpenXmlFileFromPath(XmlDocument xmlDoc, string filePath, bool forceManualExecutionMode, bool isTemplate = false, bool forceBlockRun = false) |
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
|
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Purpose
Follow-up fix for the
ForceBlockRunrefactor introduced in #17153 (DYN-9707). The legacy XML workspace open path was not updated to propagate theforceBlockRunflag, leavingHomeWorkspaceModel.RunSettings.ForceBlockRununset for any.dynfile stored in old XML format.Declarations
Check these if you believe they are true
Release Notes
N/A — internal fix to file trust enforcement; no user-visible behavior change.
Reviewers
@ivaylo-matov — follow-up to your PR #17153; please take a look.
The regression was caught by
DynamoCoreWpfTests.DynamoViewTests.OpeningWorkspaceWithTrustWarning, a test introduced in #17153 itself. The test fileTestAdd.dynis a legacy XML-format file, so the newForceBlockRunassertion exercised the XML open path. BecauseDynamoCoreWpfTestsis not run in the GitHub Actions PR CI (only in the daily Jenkins build), the failure was not visible before merge.FYIs
N/A